﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.UserRoleCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.UserRoleHandler
{
    public class UserRoleShow1CommandHandler:IRequestHandler<UserRoleShow1Command, List<UserInfo>>
    {
        IUserRoleService urSer;

        public UserRoleShow1CommandHandler(IUserRoleService urSer)
        {
            this.urSer = urSer;
        }

        public async Task<List<UserInfo>> Handle(UserRoleShow1Command request, CancellationToken cancellationToken)
        {
            return await urSer.GetRoleUserinfo(request.Rid);
        }
    }
}
